Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

cor cor

:octocat:
View GitHub Profile
@bpesquet
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
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(
Object.create(
// Set the prototype of the new object to the prototype of the instance.
@mburakerman
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
YuriyGuts / github-clone-all.py
Last active May 8, 2021
Clone all public and private repositories from a specific GitHub user or organization
View github-clone-all.py
#!/usr/bin/env python
"""
Clone all public and private repositories from a GitHub user or organization.
Copyright (c) 2018 Yuriy Guts
usage: github-clone-all.py [-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
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:
// https://github.com/bryc/code/blob/master/jshash/PRNGs.md
// Have a look at js-arbit which uses Alea:
// https://github.com/blixt/js-arbit
/**
@armstrongnate
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 = "username@gmail.com:password"
let userPasswordData = userPasswordString.dataUsingEncoding(NSUTF8StringEncoding)
let base64EncodedCredential = userPasswordData!.base64EncodedStringWithOptions(nil)
let authString = "Basic \(base64EncodedCredential)"
config.HTTPAdditionalHeaders = ["Authorization" : authString]
let session = NSURLSession(configuration: config)