git
discard all local changes/commits and pull from upstream
git reset --hard origin/master
git pull origin master
;; Objective | |
;; 1. Learn Clojure by doing Clojure | |
;; | |
;; Pre-requisites | |
;; You need to have a running Clojure REPL | |
;; see: http://clojure.org/getting_started | |
; Hello World in Clojure | |
(println "Hello World") |
#!/usr/bin/python3 | |
import os | |
for line in os.popen('ipconfig.exe'): | |
if not line[0] in [' ', '\n']: | |
current_section = line | |
active = False | |
if 'Link-local IPv6 Address' in line: | |
active = True |
var rolesQuery = new Parse.Query(Parse.Role); | |
rolesQuery.equalTo('name', 'someRole'); | |
return rolesQuery.first({useMasterKey:true}) | |
.then(function(roleObject){ | |
var user = new Parse.User(); | |
user.id = req.params.userId; | |
roleObject.getUsers().add(user); | |
return roleObject.save(null, {useMasterKey:true}); | |
}); |
Windows Registry Editor Version 5.00 | |
; | |
; Adds 'Open in Atom' to context menu (when you right click) in Windows Explorer. | |
; | |
; Based on https://github.com/Zren/atom-windows-context-menu. It didn't work | |
; https://github.com/Zren/atom-windows-context-menu/issues/1. | |
; | |
; Save this file to disk with a .reg extension. Replace C:\\Atom\\atom.exe with | |
; the path to the atom executable on your machine. |
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.graphics.OrthographicCamera; | |
import com.badlogic.gdx.graphics.g2d.BitmapFont; | |
import com.badlogic.gdx.graphics.g2d.SpriteBatch; | |
import com.badlogic.gdx.utils.Disposable; | |
import com.badlogic.gdx.utils.TimeUtils; | |
/** | |
* A nicer class for showing framerate that doesn't spam the console | |
* like Logger.log() |
git
discard all local changes/commits and pull from upstream
git reset --hard origin/master
git pull origin master
/****************************** | |
* | |
* Example "Square" | |
* created by Syd | |
* | |
*******************************/ | |
#include <GL/glew.h> | |
#include <GLFW/glfw3.h> | |
#include <cstdlib> |
import java.util.*; | |
public class Brainfuck { | |
private Scanner sc = new Scanner(System.in); | |
private final int LENGTH = 65535; | |
private byte[] mem = new byte[LENGTH]; | |
private int dataPointer; | |
public void interpret(String code) { | |
int l = 0; | |
for(int i = 0; i < code.length(); i++) { |
// O(1) | |
const todo = (state, action) => { | |
const actions = { | |
ADD_TODO: () => { | |
return { | |
id: action.id, | |
text: action.text, | |
completed: false | |
} | |
}, |
// In JavaScript, constructors can only be synchronous right now. This makes sense | |
// from the point of view that a constructor is a function that returns a newly | |
// initialized object. | |
// | |
// On the other hand, it would sometimes be very handy, if one could have async | |
// constructors, e.g. when a class represents a database connection, and it is | |
// desired to establish the connection when you create a new instance. | |
// | |
// I know that there have been discussions on this on StackOverflow & co., but | |
// the so-far mentioned counter arguments (such as: doesn't work as expected |