- Don't run as root.
- For sessions, set
httpOnly(andsecuretotrueif running over SSL) when setting cookies. - Use the Helmet for secure headers: https://github.com/evilpacket/helmet
- Enable
csrffor preventing Cross-Site Request Forgery: http://expressjs.com/api.html#csrf - Don't use the deprecated
bodyParser()and only use multipart explicitly. To avoid multiparts vulnerability to 'temp file' bloat, use thedeferproperty andpipe()the multipart upload stream to the intended destination.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # train_grpo.py | |
| # | |
| # See https://github.com/willccbb/verifiers for ongoing developments | |
| # | |
| """ | |
| citation: | |
| @misc{brown2025grpodemo, | |
| title={Granular Format Rewards for Eliciting Mathematical Reasoning Capabilities in Small Language Models}, | |
| author={Brown, William}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| default: | |
| gcc -O0 -g3 -Wall -Wextra -Wconversion -Wdouble-promotion \ | |
| -Wno-unused-parameter -Wno-unused-function -Wno-sign-conversion \ | |
| main.c | |
| format: | |
| clang-format -i main.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Download the following ZIPs: | |
| ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links) | |
| Download the correct GApps for your Android version: | |
| Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip) | |
| Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip) | |
| Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip) | |
| Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip) | |
| Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # modified from https://gist.github.com/tebeka/5426211 | |
| # updated to work with Python 3 | |
| import matplotlib | |
| matplotlib.use('Agg') | |
| from matplotlib import pyplot | |
| import numpy | |
| import cherrypy | |
| from io import BytesIO | |
| import base64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module FizzBuzzC | |
| %default total | |
| -- Dependently typed FizzBuzz, constructively | |
| -- A number is fizzy if it is evenly divisible by 3 | |
| data Fizzy : Nat -> Type where | |
| ZeroFizzy : Fizzy 0 | |
| Fizz : Fizzy n -> Fizzy (3 + n) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function implementEvents() { | |
| this._callbacks = {}; | |
| this.on = function (eventName, func, t) { | |
| if (typeof func !== 'function') | |
| throw "Invalid argument to .on() "+func | |
| if (this._callbacks[eventName]) | |
| this._callbacks[eventName].push(t?func.bind(t):func); | |
| else | |
| this._callbacks[eventName] = [t?func.bind(t):func]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var kue = require('kue'), | |
| jobs = kue.createQueue(), | |
| util = require('util'), | |
| noop = function() {}; | |
| jobs.CLEANUP_MAX_FAILED_TIME = 30 * 24 * 60 * 60 * 1000; // 30 days | |
| jobs.CLEANUP_MAX_ACTIVE_TIME = 1 * 24 * 60 * 60 * 1000; // 1 day | |
| jobs.CLEANUP_MAX_COMPLETE_TIME = 5 * 24 * 60 * 60 * 1000; // 5 days | |
| jobs.CLEANUP_INTERVAL = 5 * 60 * 1000; // 5 minutes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Thing = (function(){ | |
| var instances = [] | |
| , data = [] | |
| function setId(){ | |
| data[instances.indexOf(this)] = id | |
| } | |
| function getId(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # coding=utf-8 | |
| # Python version of Zach Holman's "spark" | |
| # https://github.com/holman/spark | |
| # by Stefan van der Walt <stefan@sun.ac.za> | |
| """ | |
| USAGE: |
NewerOlder