This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NCERT books are excellent but being altered for political or other reasons | |
# See: https://twitter.com/SouthAsiaIndex/status/1518062204058103809 | |
# To download the entire current set, run this script with Ruby | |
require 'httparty' | |
source = HTTParty.get('https://ncert.nic.in/textbook.php').force_encoding("ISO-8859-1").encode("utf-8", replace: nil) | |
# book names are like aeen1dd.zip | |
# First letter tells the class number a to l is class 1 to class 12. m stands for class 11 and 12 combined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin | |
The MIT License (MIT) | |
Copyright (c) 2015 Sandip Ransing | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
st = status | |
ci = commit | |
br = branch | |
co = checkout | |
df = diff | |
lg = log -p | |
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate | |
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat | |
lnc = log --pretty=format:"%h\\ %s\\ [%cn]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/controllers/episodes_controller.rb b/app/controllers/episodes_controller.rb | |
index e845969..0a9c282 100644 | |
--- a/app/controllers/episodes_controller.rb | |
+++ b/app/controllers/episodes_controller.rb | |
@@ -8,12 +8,18 @@ class EpisodesController < ApplicationController | |
else | |
@episodes = Episode.search_published(params[:search], params[:tag_id]) | |
end | |
+ if params[:nsfw].present? | |
+ session[:nsfw] = params[:nsfw] == 'show' ? true : nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'fileutils' | |
require 'date' | |
require 'uri' | |
# usage: ruby import.rb my-blog.xml | |
# my-blog.xml is a file from Settings -> Basic -> Export in blogger. | |
data = File.read ARGV[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// **Example Usage** | |
// $.simpleFormat("this is first \n here is next line") | |
// OR | |
// $(".note").simpleFormat() | |
(function($) { | |
$.simpleFormat = function(str) { | |
str = str.replace(/\r\n?/, "\n"); | |
str = $.trim(str); | |
if (str.length > 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
StoryJS | |
Designed and built by Zach Wise at VéritéCo | |
This Source Code Form is subject to the terms of the Mozilla Public | |
License, v. 2.0. If a copy of the MPL was not distributed with this | |
file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
*//* ********************************************** | |
Begin LazyLoad.js | |
********************************************** *//*jslint browser: true, eqeqeq: true, bitwise: true, newcap: true, immed: true, regexp: false *//* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat app/views/layouts/homepage.html.haml | |
- content_for :layout_head do | |
%script{:type=>"text/javascript", :src=>"http://maps.google.com/maps/api/js?sensor=false"} | |
- google_apis = 'https://ajax.googleapis.com/ajax/libs' | |
= javascript_include_tag "#{google_apis}/jquery/1.4.4/jquery.min.js" | |
= javascript_include_tag "#{google_apis}/jqueryui/1.8/jquery-ui.min.js" | |
= javascript_include_tag %w(rails application), :cache => false | |
= javascript_include_tag %w(placeholder maps.tooltip gmap jquery.qtip.min) | |
= javascript_include_tag "/javascripts/easySlider1.7.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heroku db:pull mysql://root@localhost/otz_production --app otz-production | |
Loaded Taps v0.3.23 | |
Warning: Data in the database 'mysql://root@localhost/otz_production' will be overwritten and will not be recoverable. | |
! WARNING: Potentially Destructive Action | |
! This command will affect the app: otz-production | |
! To proceed, type "otz-production" or re-run this command with --confirm otz-production | |
> otz-production | |
Receiving schema |
NewerOlder