Skip to content

Instantly share code, notes, and snippets.


cor cor

View GitHub Profile
bpesquet / .gitattributes-lfs-unity
Last active Jun 15, 2021
.gitattributes file for LFS with Unity
View .gitattributes-lfs-unity
* text=auto
# Unity files
*.meta -text -merge=unityamlmerge
*.unity -text -merge=unityamlmerge
*.asset -text -merge=unityamlmerge
*.prefab -text -merge=unityamlmerge
# Image formats
*.psd filter=lfs diff=lfs merge=lfs -text
GeorgeGkas / index.js
Created Jul 29, 2018
Deep copy/clone a class instance in Javascript
View index.js
* @function
* @description Deep clone a class instance.
* @param {object} instance The class instance you want to clone.
* @returns {object} A new cloned instance.
function clone(instance) {
return Object.assign(
// Set the prototype of the new object to the prototype of the instance.
mburakerman / package.json
Last active Feb 3, 2021
Webpack 4 config.js (SCSS to CSS and Babel) 👌 The Simplest Usage 👌
View package.json
"name": "webpack-sass",
"version": "1.0.0",
"scripts": {
"start": "webpack-dev-server --open --mode development",
"build": "webpack -p"
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
YuriyGuts /
Last active May 8, 2021
Clone all public and private repositories from a specific GitHub user or organization
#!/usr/bin/env python
Clone all public and private repositories from a GitHub user or organization.
Copyright (c) 2018 Yuriy Guts
usage: [-h] [--auth-user AUTH_USER]
[--auth-password AUTH_PASSWORD] [--clone-user USER]
[--clone-org ORG]
View gist:4435987a5f7af252339a
var turn = 1, withAi, firstMove, hard;
// Set all blocks taken to false
blockTaken0 = false,
blockTaken1 = false,
blockTaken2 = false,
blockTaken3 = false,
blockTaken4 = false,
blockTaken5 = false,
blixt / prng.js
Last active Jun 20, 2021
A very simple, seedable JavaScript PRNG. NOTE: Please read comments on why this is not a good choice.
View prng.js
// NOTICE 2020-04-18
// Please see the comments below about why this is not a great PRNG.
// Read summary by @bryc here:
// Have a look at js-arbit which uses Alea:
armstrongnate / basic-auth.swift
Created Jul 20, 2014
HTTP Basic Authentication using NSURLSession in swift
View basic-auth.swift
import Foundation
let config = NSURLSessionConfiguration.defaultSessionConfiguration()
let userPasswordString = ""
let userPasswordData = userPasswordString.dataUsingEncoding(NSUTF8StringEncoding)
let base64EncodedCredential = userPasswordData!.base64EncodedStringWithOptions(nil)
let authString = "Basic \(base64EncodedCredential)"
config.HTTPAdditionalHeaders = ["Authorization" : authString]
let session = NSURLSession(configuration: config)