Skip to content

Instantly share code, notes, and snippets.

@angusluk
angusluk / create order
Created August 29, 2019 03:40
create order curl
curl -X POST \
https://app.2vanx.com/graphql \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Length: 2085' \
-H 'Content-Type: application/json' \
-H 'Cookie: __cfduid=d97f45b56cc1904b2c3a89228182a84bb1553585017; __profilin=p%3Dt%2Ca%3D83c10e4d03041bb46290640e89001a68%7Cb3f06bbad51eee696929d04661f9048c' \
-H 'Host: app.2vanx.com' \
@angusluk
angusluk / gtm-logical-questions.js
Last active August 27, 2018 03:59
gtm sample on logical questions
<script>
$( document ).ready(function() {
function hideFirstLogicalQuestions(){
$("#registration-form > section.questions > div:nth-child(9)").hide()
$("#registration-form > section.questions > div:nth-child(10)").hide()
$("#registration-form > section.questions > div:nth-child(11)").hide()
$("#registration-form > section.questions > div:nth-child(12)").hide()
$("#registration-form > section.questions > div:nth-child(13)").hide()
$("#registration-form > section.questions > div:nth-child(14)").hide()
@angusluk
angusluk / solution_b.rb
Created March 10, 2018 17:12
My solution of Google codegem 2017 - Problem B. Tidy Numbers
def tidy?(number)
i = 0
number_of_digits = number.digits.count
while i < number_of_digits
array = number.digits.reverse
if (number_of_digits == 1 || i == (number_of_digits - 1 ))
return true
end
if array[i] <= array[i+1]
i += 1
@angusluk
angusluk / problem_a.rb
Created March 10, 2018 13:31
My solution of Google codegem 2017 - Problem A. Oversized Pancake Flipper
def flip(string, fliper_size, flip_at)
i = 0
if (flip_at + fliper_size) <= string.length
while i < fliper_size
if string[flip_at + i] == '-'
string[flip_at + i] = '+'
elsif string[flip_at + i] = '+'
string[flip_at + i] = '-'
end
i += 1
@angusluk
angusluk / gist:f98bd7c37e28263acb6dc970e8fe27d7
Last active October 19, 2017 07:29
sample-form-request
require 'faraday'
require 'faraday-cookie_jar'
def new_faraday_session
Faraday.new do |conn|
conn.use :cookie_jar
conn.request :url_encoded
conn.adapter :net_http
end
end
@angusluk
angusluk / slack_delete.rb
Created May 16, 2017 10:41 — forked from jamescmartinez/slack_delete.rb
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
<?xml version="1.0" encoding="UTF-8"?>
<event id="E0-001-096034895-1">
<url>http://washingtondc.eventful.com/events/psp-conference-/E0-001-096034895-1?utm_source=apis&utm_medium=apim&utm_campaign=apic</url>
<title>PSP Conference</title>
<description> PSP Conference is happening on 01 Feb 2017 at Grand Hyatt Washington Washington, United States Of America. Its a premier event in Education & Training industry. <br><br><a href="http://login.10times.com/stall-book/63241" rel="nofollow">Book a stall at 10times.com!</a></description>
<start_time>2017-02-01 00:00:00</start_time>
<stop_time>2017-02-03 00:00:00</stop_time>
<all_day>2</all_day>
<tz_id></tz_id>
<tz_olson_path></tz_olson_path>
<?xml version="1.0" encoding="UTF-8"?>
<search>
<total_items>34387</total_items>
<page_size>10</page_size>
<page_count>3439</page_count>
<page_number>1</page_number>
<page_items></page_items>
<first_item></first_item>
<last_item></last_item>
<search_time>0.067</search_time>
<?xml version="1.0" encoding="UTF-8"?>
<search>
<total_items>26913</total_items>
<page_size>10</page_size>
<page_count>2692</page_count>
<page_number>1</page_number>
<page_items></page_items>
<first_item></first_item>
<last_item></last_item>
<search_time>0.134</search_time>
@angusluk
angusluk / gist:3cd0bc053da46b67458a
Last active August 29, 2015 14:11
jijis html with youtube
<DIV style="FLOAT: right"><A href="http://www.eventxtra.com/"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; WIDTH: 160px; BORDER-TOP: 0px; BORDER-RIGHT: 0px" src="http://www.google.com/a/eventxtra.com/images/logo.gif"></A></DIV>
<DIV style="CLEAR: both"></DIV>
<H2>What EventXtra do?</H2>
<P><A href="http://www.eventxtra.com" mce_href="http://www.eventxtra.com">EventXtra</A> on a mission to helps event organizer and manager to cut cost and time through replacing labor-intensive task by mobile technology and make it extremely accessible everywhere. We provide checkin system, participant management, event engagement with accessible prices and easy-to-use functionality for all event organizers. The reason behind our vision is the frustration of boring events and low efficiency during events and post event for both event organizers and participants. Our vision is to see a world where event management, interactions are done efficiently and without any more physical limitations.</P><IFRAME height=315 src="//www.