Skip to content

Instantly share code, notes, and snippets.

View rohmanhm's full-sized avatar
💪
yes

Rohman HM rohmanhm

💪
yes
View GitHub Profile
<?php
$num = 10;
$column = $num/2;
for ($i = 1 ; $i <= $column ; $i++) {
echo $i;
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . ($i + $column) .'<br/>';
}
?>
@rohmanhm
rohmanhm / testGraphQLInputObjectType.js
Last active December 12, 2016 22:40
Test GraphQLInputObjectType
import { GraphQLInputObjectType, GraphQLString, GraphQLID } from 'graphql';
const Input = new GraphQLInputObjectType({
name: 'input',
description: 'Some input',
fields: {
id: {
type: GraphQLID
},
name: {
@rohmanhm
rohmanhm / gist:99da17e3929043ebc162d98adb7ff291
Created February 21, 2017 06:00 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@rohmanhm
rohmanhm / sequelize.flow.js
Created May 7, 2017 01:28
sequelize flow-typed
/**
* Flowtype definitions for index
* Generated by Flowgen from a Typescript Definition
* Flowgen v1.2.0
* Author: [Joar Wilk](http://twitter.com/joarwilk)
* Repo: http://github.com/joarwilk/flowgen
*/
/**
@rohmanhm
rohmanhm / computedStyleToObject.js
Created May 19, 2017 06:48
computedStyle to object
function serializeComputedStyle (computed) {
const result = {}
Object.keys(computed).forEach(key => {
if (!Number(key) && !(Number(key) <= 0)) {
result[key] = computed[key]
}
})
return result
}
@rohmanhm
rohmanhm / gh-pages-deploy.md
Created May 31, 2017 07:31 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

(id=".[^\"]*")
Demo
https://regex101.com/r/5u1Yo6/1
@rohmanhm
rohmanhm / puppeteer.d.ts
Last active February 7, 2023 12:10
Puppeteer Definition Types for Typescript
declare module 'puppeteer' {
export interface ConnectOptions {
browserWSEndpoint?: string
// a browser websocket endpoint to connect to
ignoreHTTPSErrors?: boolean
// Whether to ignore HTTPS errors during navigation. Defaults to `false`
}
export interface LaunchOptions {
ignoreHTTPSErrors?: boolean