Skip to content

Instantly share code, notes, and snippets.

View Oluwasetemi's full-sized avatar
🏠
Working from home

Oluwasetemi Ojo Oluwasetemi

🏠
Working from home
View GitHub Profile
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@paulirish
paulirish / bling.js
Last active July 3, 2024 20:45
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@bendc
bendc / recursion.js
Created May 21, 2015 08:17
Functional loop
const loop = (() => {
const recur = (callback, count, i=0) => {
if (i == count-1) return callback(i);
callback(i);
return recur(callback, count, i+1);
};
return (callback, count) => {
if (count > 0) return recur(callback, count);
};
})();
anonymous
anonymous / config.json
Created March 25, 2016 04:34
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
anonymous
anonymous / Flat UI Buttons.markdown
Created May 26, 2016 01:35
Flat UI Buttons
@Oluwasetemi
Oluwasetemi / codeSetting.json
Last active August 26, 2017 14:33
My VS code setting in json file
"files.autoSave": "afterDelay",
"files.associations": {
"*.ejs": "html"
},
"editor.wordWrap": "on",
"workbench.colorTheme": "monokai-best",
"workbench.iconTheme": "vscode-icons",
"vsicons.dontShowNewVersionMessage": true,
"window.zoomLevel": 0,
"cSpell.userWords": [
@Kaeyz
Kaeyz / truncateString
Created June 7, 2018 21:07
freecodecamp challenge: Truncate String function
function truncateString(str, num) {
if (str.length <= num) {
console.log(str);
return str;
} else {
var newStr = [];
var nstr = str.split("");
for (let index = 0; index < num; index++) {
@kentcdodds
kentcdodds / sequential-promises.js
Created June 12, 2018 15:11
Different mechanisms for making async work sequential.
// code for my devtip on 12 June 2018:
// https://www.youtube.com/watch?v=0wiM3jW1DVY&list=PLV5CVI1eNcJgCrPH_e6d57KRUTiDZgs0u
const loadFile = file => {
return new Promise(resolve => {
setTimeout(() => {
resolve(`contents of ${file}`)
}, 500)
})
}
const files = ['01.md', '02.md', '03.md', '04.md', '05.md']
@whoisryosuke
whoisryosuke / gatsbyjs-graphql-excerpt.graphql
Created July 19, 2018 23:57
GatsbyJS - Set the excerpt length of your Markdown files -- via: https://using-remark.gatsbyjs.org/excerpts/
{
allMarkdownRemark {
edges {
node {
excerpt(pruneLength: 280)
}
}
}
}