Skip to content

Instantly share code, notes, and snippets.

View abdullahtariq1171's full-sized avatar

Abdullah abdullahtariq1171

View GitHub Profile
@abdullahtariq1171
abdullahtariq1171 / gist:7bf3d24911693a15d6a574f0778f6457
Created July 10, 2020 06:03 — forked from solenoid/gist:1372386
javascript ObjectId generator
var mongoObjectId = function () {
var timestamp = (new Date().getTime() / 1000 | 0).toString(16);
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() {
return (Math.random() * 16 | 0).toString(16);
}).toLowerCase();
};
@abdullahtariq1171
abdullahtariq1171 / Counter.js
Created May 3, 2020 22:02 — forked from tannerlinsley/Counter.js
Global React State with Context and Immer
import { useCount, useIncrement, useDecrement } from './store.Count'
export default function Counter () {
const count = useCount()
const increment = useIncrement()
const decrement = useDecrement()
return (
<div>
<div>Count: {count}</div>
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
@abdullahtariq1171
abdullahtariq1171 / input-sample
Created November 17, 2018 16:30
input-sample
{"seatingPlan":{"seatingAreas":[{"fuid":"standard","name":"Standard","seatingIsAllocated":true},{"fuid":"vip","name":"VIP","seatingIsAllocated":true}],"seats":[{"foreignAttributes":{"area_id":"standard","style_modifier":"standard","id":"0000000001_001_017_031","column_index":31,"row_index":17,"name":"A30","status":0,"priority":5},"location":{"column":0,"row":0},"name":"A30","seatingAreaFuid":"standard","state":"0","type":"standard"},{"foreignAttributes":{"area_id":"standard","style_modifier":"standard","id":"0000000001_001_017_030","column_index":30,"row_index":17,"name":"A29","status":0,"priority":5},"location":{"column":1,"row":0},"name":"A29","seatingAreaFuid":"standard","state":"0","type":"standard"},{"foreignAttributes":{"area_id":"standard","style_modifier":"standard","id":"0000000001_001_017_029","column_index":29,"row_index":17,"name":"A28","status":0,"priority":5},"location":{"column":2,"row":0},"name":"A28","seatingAreaFuid":"standard","state":"0","type":"special"},{"foreignAttributes":{"area_id":"s
{"@timestamp":"2018-03-11T07:27:00.476+00:00","@version":1,"message":"{\"log_key\":\"error/handled\",\"request_id\":\"local:system:cjemh7arg00050192h0bjutfb\",\"client_id\":\"cjel5upmm00000192tk36pkcl\",\"payload\":{\"exception\":\"cool.graph.shared.errors.SystemErrors$InvalidProjectId: No service with id 'cjele3cyy1avy0121jyy8d9dp'\",\"query\":\"\\n query ($projectId: ID!){\\n viewer {\\n project(id: $projectId) {\\n ...RemoteProject\\n }\\n }\\n }\\n \\n fragment RemoteProject on Project {\\n id\\n name\\n schema\\n alias\\n region\\n isEjected\\n projectDefinitionWithFileContent\\n }\\n\\n \",\"variables\":{\"projectId\":\"cjele3cyy1avy0121jyy8d9dp\"},\"code\":4000,\"stack_trace\":\"cool.graph.system.database.finder.ProjectFinder$.loadById(ProjectFinder.scala:18), cool.graph.system.schema.types.Viewer$$anonfun$2.apply(Viewer.scala:55), cool.graph.system.schema.types.Viewer$$anonfun$2.apply(Viewer.scala:52), sangria.execut
#rails alias
alias rs="rails s "
alias rc="rails c "
#git alias
alias gs="git status "
alias gd="git diff "
alias gc="git checkout "

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@abdullahtariq1171
abdullahtariq1171 / ffmpeg-install.sh
Last active November 5, 2016 19:01 — forked from patmandenver/ffmpeg-install.sh
ffmpeg install script for Ubuntu 14.04
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run with admin privileges 'sudo'"
echo "exiting...."
exit 1
fi
echo "*********************************"
echo "*"
<asp:Repeater runat="server" ID="repeater1" onitemdatabound="Repeater1_ItemDataBound" >
<ItemTemplate>
<!--Print Question Statement Here -->
<asp:repeater id="repeater2" runat="server">
<itemtemplate>
<!--Print Choices Here -->
</itemtemplate>
</asp:repeater>
</ItemTemplate>
</asp:Repeater>