Skip to content

Instantly share code, notes, and snippets.

@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@ravibhure
ravibhure / git_rebase.md
Last active June 25, 2024 13:44
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@skipjac
skipjac / hc_ticket_fields.html
Last active August 29, 2015 14:02
Set default dropdown values in Zendesk Help Center. This is just the code to set the actual value.
<div class="form-field string required request_custom_fields_21631456">
<label for="request_custom_fields_21631456">fav</label>
<input autocomplete="off" data-tagger=data-tagger="{"-":{"id":"","title":"-","selected":true},"pet":{"cat":{"id":"cat","title":"pet::cat"},"dog":{"id":"dog","title":"pet::dog"}},"Dolphin":{"id":"dolphin","title":"Dolphin"},"the fish":{"id":"the_fish","title":"the fish"}}" id="request_custom_fields_21631456" name="request[custom_fields][21631456]" size="0" type="hidden" value="">
<a class="nesty-input" tabindex="0">-</a>
</div>
<script>
//in order to set the value of the field and make it visible set the input value and anchor text
//so this will set the field fav to The fish
$('.request_custom_fields_21631456').one('DOMNodeInserted', function(d){
@runeb
runeb / js-exif-rotate.html
Created May 23, 2014 10:49
Auto-rotate images locally in the browser by parsing exif data
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<input id="file" type="file" accept="image/*" />
<br/>
<h2>As read:</h2>
<img id="placeholder1" width=300/><br/>
<h2>Rotated by exif data:</h2>
<img id="placeholder2" width=300/>
<script>
<div class="test-div"></div>