Skip to content

Instantly share code, notes, and snippets.

View StephanWeinhold's full-sized avatar

Stephan Weinhold StephanWeinhold

View GitHub Profile
@chrislaughlin
chrislaughlin / travis.md
Created March 31, 2018 16:20
Using Travis CI with Gatsby

First set out your build scripts In your package.json scripts and install the gh-pages npm module

"build": "gatsby build",
"test": "echo \"no test specified\" && exit 0",
"preDeploy": "gatsby build --prefix-paths",
"deploy": "npm run preDeploy && gh-pages -d public"

Connect Travis CI to your repo and in the repo settings add an enviroment var call GITHUB_TOKEN with the value of your github token from:

@Ajax30
Ajax30 / chromeLoginDataExporter.js
Last active July 9, 2017 16:09
Export the passwords stored in your Google Chrome browser
var decryptedRow="";
var pm = PasswordManager.getInstance();
var model = pm.savedPasswordsList_.dataModel;
var pl = pm.savedPasswordsList_;
for(i=0;i<model.length;i++){
PasswordManager.requestShowPassword(i);
};
setTimeout(function(){
var bootstrapStylesheet = '<link rel="stylesheet" type="text/css" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">';
tableStart = '<table class="table table-striped"><thead>';
@kopiro
kopiro / nbn.js
Created February 25, 2016 20:49
Next bigger number with the same digits
function nextBigger(n){
var d = n.toString().split('');
// find the pivot, the point (from right) where i > i-1
var p = -1;
for (var i = d.length-1; i > 0; i--) {
if (+d[i] > +d[i-1]) {
p = i-1;
break;
}
@sgnl
sgnl / _notes.md
Last active August 26, 2022 03:03
AJAX with Vanilla Javascript. (XMLHttpRequest)

Short XHR Examples

Examples shown are bare minimum needed to achieve a simple goal.

Resources

  • Google Chrome's Dev Tools' Network Panel c-c-c-c-c-ULTIMATE c-c-c-COMBO!!!
  • requestb.in enpoints for your HTTP Requests as a free service.
// See https://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit, jQuery version with arrays and objects support
function post(path, parameters) {
var form = $('<form></form>');
form.attr("method", "post");
form.attr("action", path);
$.each(parameters, function(key, value) {
if ( typeof value == 'object' || typeof value == 'array' ){
$.each(value, function(subkey, subvalue) {
@rxaviers
rxaviers / gist:7360908
Last active May 4, 2024 13:48
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@brandonheyer
brandonheyer / rgbToHSL.php
Last active June 12, 2021 06:49
PHP snippet to convert RGB to HSL and HSL to RGB.
<?
function rgbToHsl( $r, $g, $b ) {
$oldR = $r;
$oldG = $g;
$oldB = $b;
$r /= 255;
$g /= 255;
$b /= 255;
@isellsoap
isellsoap / yearly-archive.php
Created December 17, 2012 16:24 — forked from anonymous/Kirby Archive
Kirby: yearly archive of blog articles.
<?php
$blog_uri = 'blog';
$articles = $pages->find( $blog_uri )->children()->visible()->sortBy( $sort='date', $dir='desc' );
$year = date( 'Y' );
?>
<ul>
<?php
// loop through blog articles
@c0ldlimit
c0ldlimit / git_newrepo
Created November 16, 2012 17:14
Git: Push a new or existing repo to Github
# Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/c0ldlimit/vimcolors.git
git push -u origin master
# Push an existing repository from the command line
@zspine
zspine / Example.php
Created February 22, 2012 17:33
Pimcore Object toArray()
<?php
class Website_Model_Product extends Object_Concrete
{
/**
* Retreive the values in an array
*
* @return array
*/
public function toArray()